salt-minion-install:
  pkg.installed:
    - name: salt-minion
    - unless: rpm -aq|grep salt-minion
    
salt-minion-config:
  file.managed:
    - name: /etc/salt/minion
    - source: salt://init/files/minion
    - user: root
    - group: root
    - mode: 644
    - Id:  {{ grains['id'] }}
    - SALT1: {{ pillar['internal_salt1'] }}
    - SALT2: {{ pillar['internal_salt2'] }}
    - template: jinja
    - require:
      - pkg : salt-minion-install

salt-minion-service:
  service.running:
    - name: salt-minion
    - enable: True
    - require:
      - file: salt-minion-config
